<?php 
include('../Connections/KRAPPERCON.php');
$to = 'PEN';
$from = $_POST['from'];
$fecha = $_POST['fecha'];
$val = $_POST['monto'];
$tc = 0;
$ret = "0.0";
if ($from!=$to){
	$sql = "call sp_getTC('".$fecha."','".$from."','".$to."');";
	$res = $mysqli->query($sql);	
	if ($res){
		if ($row = $res->fetch_assoc()){
			$tc = $row['value'];
			$ret = $row['value'] * $val;	
		}
	$res->close();
	$mysqli->check_result();
	}
}
echo "{ value : '".$ret."',  tc : '".$tc."'}";
?>